package guoanmaker.provider.business.repository;

import guoanmaker.provider.business.model.ProvideShop;
import guoanmaker.provider.business.model.ProvideShopFollow;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;

/**
 * DESC:
 * Created by JTing on 2017/12/17 10:33
 */
public interface ProvideShopFollowRepository extends JpaRepository<ProvideShopFollow,String> ,JpaSpecificationExecutor<ProvideShopFollow> {
    @Query("select t from ProvideShopFollow t where t.provideShop.id =:shopId and t.userId=:userId")
    ProvideShopFollow findShopFollow(@Param("shopId") String shopId,@Param("userId") String userId);
}
